<script setup lang="ts">
import { onMounted } from 'vue'
import { useCounterStore } from "./store/counter";
// 调用函数获取 store
const store = useCounterStore()

onMounted(() => {
  store.getChannelList()
})


</script>

<template>
<p>{{ store }}</p>
<p>store.count:{{ store.count }}</p>
<p>store.doubleCount:{{ store.doubleCount }}</p>
<button @click="store.addCount(1)">点击+1</button>
<button @click="store.addCount(-1)">点击-1</button>

<ul>
  <li v-for="item in store.channelList" :key="item.id">
    {{ item.name }}
  </li>
</ul>


</template>

<style scoped>

</style>
